package cate.game.role.farm.dailyfb.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdDailyFb;
import cate.game.role.farm.dailyfb.DailyFb;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

@OperationSetter(value = GDOperation.DAILY_FB_CHALLENGE,sub = "type")
@ClientMsg(title = "每日副本一键扫荡 の 请求 ")
public class DailyFbBatchMopReq implements MsgInput {
    @NoteField(value = "副本类型")
    public int type;

    @NoteField(value = "包含付费")
    public boolean pay;


    @Override
    public MsgConfig conf() {
        return MsgIdDailyFb.BATCH_MOP_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        EcResult<DailyFb> r = cc.getRole().getFarm().dailyFb.batchMopType(type, pay);
        if (r.ok()) {
            cc.getRole().sendNow(new DailyFbDataResp(cc.getRole()));
        } else {
            game.notice.message(cc.getRole(), r, true);
        }
    }
}
